﻿using Prism.Commands;
using Prism.Mvvm;
using RoboAssembleX.Application.AddBoard1;
using RoboAssembleX.Application.AddGlass;
using RoboAssembleX.Application.AddGlass1;
using RoboAssembleX.Application.Robot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RoboAssembleX.ViewModels
{
    public class ViewAddGlass1ControlViewModel : BindableBase
    {
        private readonly AddGlass1Service AddGlass1Service;
        public addGlass1Model AddGlass1Model { get; }
        public DelegateCommand<string> ButtonCommand { get; private set; }
        public ViewAddGlass1ControlViewModel(AddGlass1Service AddGlass1Service, addGlass1Model AddGlass1Model)
        {
            this.AddGlass1Service = AddGlass1Service;
            this.AddGlass1Model = AddGlass1Model;
            ButtonCommand = new DelegateCommand<string>(ButtonMethod);


            Task.Run(async () =>
            {
                await Task.Delay(1000);
                AddGlass1Service.SwitchReadData();
            });
        }
        private void ButtonMethod(string menuName)
        {
            switch (menuName)
            {
                case "SwitchReadData":
                    AddGlass1Service.SwitchReadData();
                    break;
                case "Action":
                    AddGlass1Service.Action();
                    break;
            }
        }

    }
}
